<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>[[${tenantNickname}]]登录</title>
    <meta name="description" th:content="@{${tenantNickname}}">
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../static/css/style.css" th:href="@{/css/style.css}" rel="stylesheet"/>
    <link href="../static/css/login.css" th:href="@{/css/login.css}" rel="stylesheet"/>
    <link href="../static/doseng/css/doseng-ui.css" th:href="@{/doseng/css/doseng-ui.css?v=4.2.0}" rel="stylesheet"/>
    <!-- 360浏览器急速模式 -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" th:href="@{${titlepath}}"/>
    <style type="text/css">
        label.error {
            position: inherit;
        }
    </style>
    <script>
        // (function () {
        //     window.alert = function (name) {
        //         var iframe = document.createElement("IFRAME");
        //         iframe.style.display = "none";
        //         iframe.setAttribute("src", 'data:text/plain');
        //         document.documentElement.appendChild(iframe);
        //         window.frames[0].window.alert(name);
        //         iframe.parentNode.removeChild(iframe);
        //     }
        // })();
        if (window.top !== window.self) {
            alert([[#{login.no.timeout}]]);
            top.location.reload();
        }
        ;
    </script>
</head>
<body class="signin" th:style="'background:url(' + @{${bgpath}}+ ') no-repeat;background-size:100% 100%;'" >
<div class="signinpanel">
    <div class="row">
        <div class="col-sm-6 col-sm-offset-6">
            <form id="signupForm" autocomplete="off">
                <h1 class="no-margins" style="text-align: center;padding-bottom: 8px;">[[${tenantNickname}]]</h1>
                <input type="text" name="username" class="form-control uname" th:placeholder="#{login.submit.username}" value="" required/>

                <div class="form-control pword">
                    <input type="password" id="password" name="password" class="input-psw" th:placeholder="#{login.submit.password}" value="" required/>
                    <i class="fa fa-eye-slash" style="float: right;" id="psweye" onclick="psw_eye(this,'password')"></i>
                </div>
                <!--<input type="password" name="password" class="form-control pword" th:placeholder="#{login.submit.password}" value=""/>-->

                <div class="row m-t" th:if="${captchaEnabled==true}">
                    <div class="col-xs-8">
                        <input type="text" name="validateCode" class="form-control code" th:placeholder="#{login.submit.validateCode}"
                               maxlength="5"/>
                    </div>
                    <div class="col-xs-4">
                        <a href="javascript:void(0);" th:title="#{login.submit.change.validateCode}">
                            <img class="imgcode" width="100%" height="34px"/>
                        </a>
                    </div>
                </div>
                <div class="checkbox-custom" th:classappend="${captchaEnabled==false} ? 'm-t'" style="width: 100%">
				        <span style="float:left; ">
                            <input type="checkbox" id="rememberme" name="rememberme"> <label
                                for="rememberme">[[#{login.submit.rememberme}]]</label>
                        </span>
                    <!--<strong th:if="${@config.getKey('sys.account.registerUser')}">-->
                    <!--还没有账号？ <a th:href="@{/register}">[[#{login.register}]]&raquo;</a>-->
                    <!--</strong>-->
                    <strong style="float:right;">
                        <a th:href="@{${'/hotel/forgotpsw/'+ portalCode + '/pswretrieve' }}">[[#{login.submit.pswretrieve}]]?&raquo;</a>
                    </strong>
                </div>

                <a class="btn btn-sm" href="?lang=zh_CN" th:text="#{language.zh.cn}"></a>
                <a class="btn btn-sm" href="?lang=zh_HK" th:text="#{language.zh.hk}"></a>
                <a class="btn btn-sm" href="?lang=en_US" th:text="#{language.en.us}"></a>
                <button class="btn btn-success btn-block" id="btnSubmit" th:data-loading="#{login.submit.ing}">[[#{login.submit}]]</button>

                <!--<h1></h1>-->
                <!--<span style="float:left;">-->
                        <!--<a th:href="@{/rouces/exe/}"-->
                           <!--style="color: #FFFFFF;">客户端最新版本(1.4.2)下载 &raquo;</a>-->
                    <!--</span>-->
                <!--&lt;!&ndash;<h1></h1>&ndash;&gt;-->
                <!--<span style="float:right;">-->
                        <!--<a th:href="@{/rouces/doc/}" style="color: #FFFFFF;">操作说明文档下载 &raquo;</a>-->
                    <!--</span>-->
            </form>
        </div>
    </div>
    <div class="signup-footer">
        <div class="pull-right">
            © [[${copyrightYear}]] [[${objname}]] [[${version}]] Copyright <br>
        </div>
    </div>
</div>
<script th:inline="javascript"> var ctx = [[@{
    /}]]; var captchaType = [[${captchaType}]]; var portalCode = [[${portalCode}]]</script>
<!-- 全局js -->
<script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
<script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
<!-- 验证插件 -->
<script src="../static/ajax/libs/validate/jquery.validate.min.js"
        th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
<script src="../static/ajax/libs/validate/messages_zh.min.js"
        th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="../static/doseng/js/doseng-ui.js" th:src="@{/doseng/js/doseng-ui.js?v=4.2.0}"></script>
<script src="../static/doseng/login.js" th:src="@{/doseng/login.js}"></script>

<!--[if IE]>
<script>
    $(
            function () {
                // debugger;

                $(
                        function () {

                            // 判断浏览器是否支持 placeholder
                            if (!placeholderSupport()) {
                                $('[placeholder]').each(
                                        function () {
                                            $(this)
                                                    .focus(
                                                            function () {
                                                                var input = $(this);
                                                                if (input.val() == input.attr('placeholder')) {
                                                                    input.val('');
                                                                    input.removeClass('placeholder');
                                                                }
                                                            }
                                                    )
                                                    .blur(
                                                            function () {
                                                                var input = $(this);
                                                                if (input.val() == '' || input.val() == input.attr('placeholder')) {
                                                                    input.addClass('placeholder');
                                                                    input.val(input.attr('placeholder'));

                                                                    if (input.attr('type') === 'password') {
                                                                        input.attr('type', 'text');
                                                                        // $('[id="psweye"]').hide();
                                                                    }
                                                                }
                                                            }
                                                    )
                                                    .bind(
                                                            'input propertychange',
                                                            function () {
                                                                var input = $(this);
                                                                if (input.attr('type') === 'text' && input.attr('name') === 'password') {
                                                                    input.attr('type', 'password');
                                                                    // $('[id="psweye"]').show();
                                                                } else {
                                                                    if (input.attr('type') === 'text') {
                                                                        // $('[id="psweye"]').hide();
                                                                    }
                                                                }
                                                            }
                                                    )
                                                    .blur();
                                        }
                                )
                            }

                            $('#signupForm').bind(
                                    'submit',
                                    function () {
                                        var passwordInput = $('[name="password"]');
                                        if (passwordInput.attr('type') === 'text' &&
                                                passwordInput.val() === '输入密码') {
                                            passwordInput.val('');
                                            $('#signupForm').submit();
                                            passwordInput.val('输入密码');
                                        }
                                    }
                            );
                        }
                );
            }
    );

    function placeholderSupport() {
        return 'placeholder' in document.createElement('input');
    }
</script>
<![endif]-->
</body>
</html>
